﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Products;
using MinhTuan;
public partial class users_userdetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        String[] user = Session["user"].ToString().Split(',');
        int id = int.Parse(user[0]);
        Members mymember = Members.GetMemberinfo(id);
        if (id < 0) Response.Redirect("http://localhost:2011/didong");
        if (!IsPostBack)
        {
            
                Binddata(id);
               

        }

    }
    protected void Binddata(int id)
    {
        Members mymember = Members.GetMemberinfo(id);
        hdid.Value = mymember.Members_Id.ToString();
        cname.Text = mymember.Members_Name;
        cemail.Text = mymember.Members_Mail;
        ctel.Text = mymember.Members_Tel;
        caddress.Text = mymember.Members_Address;
        ccity.Text = mymember.Members_City;
        //show order
        this.Lproducts.DataSource = Orders.GetOrderByMember(id);
        this.Lproducts.DataBind();
    }
    protected void Lproducts_ItemDeleting(object sender, ListViewDeleteEventArgs e)
    {

    }
    protected void Lproducts_ItemUpdating(object sender, ListViewUpdateEventArgs e)
    {

    }
    protected void btncapnhat_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://localhost:2011/didong/users/UpdateInfo.aspx?Id="+ hdid.Value.ToString());
    }
}
